package com.tenbent.product.center.token.dto;

import javax.xml.bind.annotation.*;
import java.io.Serializable;

/**
 * 获取 token DTO
 *
 * Created by ThinkPad on 2017/10/19.
 */

@XmlAccessorType(XmlAccessType.PROPERTY)
// XML文件中的根标识
@XmlRootElement(name = "DefaultOAuth2AccessToken")
// 控制JAXB 绑定类中属性和字段的排序
public class AccessTokenDto implements Serializable {

	private static final long serialVersionUID = 1L;

	private String accessToken;

	private String tokenType;

	private String refreshToken;

	private Integer expiresIn;

	private String scope;

	public AccessTokenDto() {
		super();
	}

	public AccessTokenDto(String accessToken, String tokenType, String refreshToken, Integer expiresIn, String scope) {
		super();
		this.accessToken = accessToken;
		this.tokenType = tokenType;
		this.refreshToken = refreshToken;
		this.expiresIn = expiresIn;
		this.scope = scope;
	}

	@XmlElement(name = "access_token")
	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	@XmlElement(name = "token_type")
	public String getTokenType() {
		return tokenType;
	}

	public void setTokenType(String tokenType) {
		this.tokenType = tokenType;
	}

	@XmlElement(name = "refresh_token")
	public String getRefreshToken() {
		return refreshToken;
	}

	public void setRefreshToken(String refreshToken) {
		this.refreshToken = refreshToken;
	}

	@XmlElement(name = "expires_in")
	public Integer getExpiresIn() {
		return expiresIn;
	}

	public void setExpiresIn(Integer expiresIn) {
		this.expiresIn = expiresIn;
	}

	@XmlElement(name = "scope")
	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	@Override
	public String toString() {
		return "AccessTokenDto{" + "accessToken='" + accessToken + '\'' + ", tokenType='" + tokenType + '\''
				+ ", refreshToken='" + refreshToken + '\'' + ", expiresIn=" + expiresIn + ", scope='" + scope + '\''
				+ '}';
	}
}
